package com.ebs.md.container;

import java.util.ArrayList;
import java.util.List;
import com.ebs.commons.logger.MessageText;
import org.apache.log4j.Logger;

public class Manager {
    private List<ManagedObject> m_objects;

    private static Logger s_logger = Logger.getLogger(Manager.class);

    public void setManagedObjects(List<ManagedObject> objects) {
        m_objects = new ArrayList<ManagedObject>(objects);
    }

    public void start() throws Exception {
        for (ManagedObject object : m_objects) {
            s_logger.info(new MessageText("LIFECYCLE_START", object));
            object.execute();
        }
    }
}